package com.link2room.optimus.controller.inside;


import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.optimus.facade.IMarketingFacadeService;
import com.link2room.ironhide.dto.param.inside.HotelMinPriceInsideParamDto;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by sss on 2016/8/26.
 */
@Api(tags = "酒店最低价")
@RestController
@RequestMapping("/in/HotelMinPrices")
public class HotelMinPriceInsideController {
    @Resource
    private IMarketingFacadeService marketingFacadeService;

    @RequestMapping(method= RequestMethod.GET)
    public BaseResultDto hotelMinPrices(
            @RequestParam(value = "lhotelCode" ,required = false) String lhotelCode,
            @RequestParam(value = "pbChannel" ,required = false) String pbChannel,
            @RequestParam(value = "startDatetime" ,required = false) String startDatetime,
            @RequestParam(value = "endDatetime" ,required = false) String endDatetime
    ) throws Exception {
        HotelMinPriceInsideParamDto hotelMinPriceInsideParamDto =new HotelMinPriceInsideParamDto();
        hotelMinPriceInsideParamDto.setLhotelCode(lhotelCode);
        hotelMinPriceInsideParamDto.setStartDatetime(startDatetime);
        hotelMinPriceInsideParamDto.setEndDatetime(endDatetime);
        hotelMinPriceInsideParamDto.setPbChannel(pbChannel);
        BaseResultDto l2rRs=new BaseResultDto();
        l2rRs.setResultCode(0);
        l2rRs.setQueryResult(marketingFacadeService.getHoteMinPrice(hotelMinPriceInsideParamDto));
        return l2rRs;
    }
}
